<!DOCTYPE html>
<html>

<head>
  <title>Quarkus - Kubernetes extension</title>
  <script id="adobe_dtm" src="https://www.redhat.com/dtm.js" type="text/javascript"></script>
  <script src="/assets/javascript/highlight.pack.js" type="text/javascript"></script>
  <META HTTP-EQUIV='Content-Security-Policy' CONTENT="default-src 'none'; script-src 'self' 'unsafe-eval' 'sha256-ANpuoVzuSex6VhqpYgsG25OHWVA1I+F6aGU04LoI+5s=' 'sha256-ipy9P/3rZZW06mTLAR0EnXvxSNcnfSDPLDuh3kzbB1w=' js.bizographics.com https://www.redhat.com assets.adobedtm.com jsonip.com https://ajax.googleapis.com https://www.googletagmanager.com https://www.google-analytics.com https://use.fontawesome.com; style-src 'self' https://fonts.googleapis.com https://use.fontawesome.com; img-src 'self' *; media-src 'self' ; frame-src https://www.googletagmanager.com https://www.youtube.com; frame-ancestors 'none'; base-uri 'none'; object-src 'none'; form-action 'none'; font-src 'self' https://use.fontawesome.com https://fonts.gstatic.com;">
  <META HTTP-EQUIV='X-Frame-Options' CONTENT="DENY">
  <META HTTP-EQUIV='X-XSS-Protection' CONTENT="1; mode=block">
  <META HTTP-EQUIV='X-Content-Type-Options' CONTENT="nosniff">
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="Quarkus: Supersonic Subatomic Java">
  <meta name="twitter:card" content="summary_large_image">
  <meta name="twitter:site" content="@QuarkusIO"> 
  <meta name="twitter:creator" content="@QuarkusIO">
  <meta property="og:url" content="https://quarkus.io/guides/deploying-to-kubernetes" />
  <meta property="og:title" content="Quarkus - Kubernetes extension" />
  <meta property="og:description" content="Quarkus: Supersonic Subatomic Java" />
  <meta property="og:image" content="/assets/images/quarkus_card.png" />
  <link rel="canonical" href="https://quarkus.io/guides/deploying-to-kubernetes">
  <link rel="shortcut icon" type="image/png" href="/favicon.ico" >
  <link rel="stylesheet" href="https://quarkus.io/guides/stylesheet/config.css" />
  <link rel="stylesheet" href="/assets/css/main.css" />
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">
  <link rel="alternate" type="application/rss+xml"  href="https://quarkus.io/feed.xml" title="Quarkus">
  <script src="https://quarkus.io/assets/javascript/goan.js" type="text/javascript"></script>
  <script src="https://quarkus.io/assets/javascript/hl.js" type="text/javascript"></script>
</head>

<body class="guides">
  <!-- Google Tag Manager (noscript) -->
  <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NJWS5L"
  height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
  <!-- End Google Tag Manager (noscript) -->

  <div class="nav-wrapper">
  <div class="grid-wrapper">
    <div class="width-12-12">
      <input type="checkbox" id="checkbox" />
      <nav id="main-nav" class="main-nav">
  <div class="container">
    <div class="logo-wrapper">
      
        <a href="/"><img src="/assets/images/quarkus_logo_horizontal_rgb_600px_reverse.png" class="project-logo" title="Quarkus"></a>
      
    </div>
    <label class="nav-toggle" for="checkbox">
      <i class="fa fa-bars"></i>
    </label>
    <div id="menu" class="menu">
      <span>
        <a href="/get-started/" class="">Get Started</a>
      </span>
      <span>
        <a href="/guides/" class="active">Guides</a>
      </span>
      <span>
        <a href="/community/" class="">Community</a>
      </span>
      <span>
        <a href="/support/" class="">Support</a>
      </span>
      <span>
        <a href="/blog/" class="">Blog</a>
      </span>
      <span>
        <a href="https://code.quarkus.io" class="button-cta secondary white">Start Coding</a>
      </span>
    </div>
  </div>
      </nav>
    </div>
  </div>
</div>

  <div class="content">
    <div class="guide">
  <div class="width-12-12">
    <h1 class="text-caps">Quarkus - Kubernetes extension</h1>
    <div class="hide-mobile toc"><ul class="sectlevel1">
<li><a href="#prerequisites">Prerequisites</a></li>
<li><a href="#kubernetes">Kubernetes</a>
<ul class="sectlevel2">
<li><a href="#defining-a-docker-registry">Defining a Docker registry</a></li>
<li><a href="#labels-and-annotations">Labels and Annotations</a></li>
<li><a href="#changing-the-number-of-replicas">Changing the number of replicas:</a></li>
<li><a href="#add-readiness-and-liveness-probes">Add readiness and liveness probes</a></li>
<li><a href="#customizing-the-readiness-probe">Customizing the readiness probe:</a></li>
<li><a href="#using-the-kubernetes-client">Using the Kubernetes client</a></li>
<li><a href="#deploying-to-minikube">Deploying to Minikube</a></li>
</ul>
</li>
<li><a href="#tuning-the-generated-resources-using-application-properties">Tuning the generated resources using application.properties</a>
<ul class="sectlevel2">
<li><a href="#configuration-options">Configuration options</a></li>
<li><a href="#openshift">OpenShift</a></li>
<li><a href="#knative">Knative</a></li>
<li><a href="#deployment-targets">Deployment targets</a></li>
<li><a href="#deprecated-configuration">Deprecated configuration</a></li>
</ul>
</li>
<li><a href="#deployment">Deployment</a>
<ul class="sectlevel2">
<li><a href="#building-a-container-image">Building a container image</a></li>
<li><a href="#deploying">Deploying</a></li>
</ul>
</li>
<li><a href="#using-existing-resources">Using existing resources</a></li>
</ul></div>
    <div>
      <div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Quarkus offers the ability to automatically generate Kubernetes resources based on sane defaults and user-supplied configuration using <a href="https://github.com/dekorateio/dekorate/">dekorate</a>.
It currently supports generating resources for vanilla <a href="#kubernetes">Kubernetes</a>, <a href="#openshift">OpenShift</a> and <a href="#knative">Knative</a>.
Furthermore, Quarkus can deploy the application to a target Kubernetes cluster by applying the generated manifests to the target cluster&#8217;s API Server.
Finally, when either one of container image extensions is present (see the <a href="container-image">container image guide</a> for more details), Quarkus has the ability to create a container image and push it to a registry <strong>before</strong> deploying the application to the target platform.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="prerequisites"><a class="anchor" href="#prerequisites"></a>Prerequisites</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To complete this guide, you need:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>roughly 10 minutes</p>
</li>
<li>
<p>an IDE</p>
</li>
<li>
<p>JDK 1.8+ installed with <code>JAVA_HOME</code> configured appropriately</p>
</li>
<li>
<p>Apache Maven 3.6.2+</p>
</li>
<li>
<p>access to a Kubernetes cluster (Minikube is a viable option)</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="kubernetes"><a class="anchor" href="#kubernetes"></a>Kubernetes</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Let&#8217;s create a new project that contains both the Kubernetes and Jib extensions:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">mvn io.quarkus:quarkus-maven-plugin:1.7.0.Final:create \
    -DprojectGroupId=org.acme \
    -DprojectArtifactId=kubernetes-quickstart \
    -DclassName="org.acme.rest.GreetingResource" \
    -Dpath="/greeting" \
    -Dextensions="kubernetes, jib"
cd kubernetes-quickstart</code></pre>
</div>
</div>
<div class="paragraph">
<p>This added the following dependencies to the <code>pom.xml</code></p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="xml" class="language-xml hljs">    &lt;dependency&gt;
      &lt;groupId&gt;io.quarkus&lt;/groupId&gt;
      &lt;artifactId&gt;quarkus-kubernetes&lt;/artifactId&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;io.quarkus&lt;/groupId&gt;
      &lt;artifactId&gt;quarkus-container-image-jib&lt;/artifactId&gt;
    &lt;/dependency&gt;</code></pre>
</div>
</div>
<div class="paragraph">
<p>By adding these dependencies, we enable the generation of Kubernetes manifests each time we perform a build while also enabling the build of a container image using Jib.
For example, following the execution of <code>./mvnw package</code>, you will notice amongst the other files that are created, two files named
<code>kubernetes.json</code> and <code>kubernetes.yml</code> in the <code>target/kubernetes/</code> directory.</p>
</div>
<div class="paragraph">
<p>If you look at either file you will see that it contains both a Kubernetes <code>Deployment</code> and a <code>Service</code>.</p>
</div>
<div class="paragraph">
<p>The full source of the <code>kubernetes.json</code> file looks something like this:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="json" class="language-json hljs">{
  {
    "apiVersion" : "apps/v1",
    "kind" : "Deployment",
    "metadata" : {
      "annotations": {
       "app.quarkus.io/vcs-url" : "&lt;some url&gt;",
       "app.quarkus.io/commit-id" : "&lt;some git SHA&gt;",
      },
      "labels" : {
        "app.kubernetes.io/name" : "test-quarkus-app",
        "app.kubernetes.io/version" : "1.0-SNAPSHOT",
      },
      "name" : "test-quarkus-app"
    },
    "spec" : {
      "replicas" : 1,
      "selector" : {
        "matchLabels" : {
          "app.kubernetes.io/name" : "test-quarkus-app",
          "app.kubernetes.io/version" : "1.0-SNAPSHOT",
        }
      },
      "template" : {
        "metadata" : {
          "labels" : {
            "app.kubernetes.io/name" : "test-quarkus-app",
            "app.kubernetes.io/version" : "1.0-SNAPSHOT"
          }
        },
        "spec" : {
          "containers" : [ {
            "env" : [ {
              "name" : "KUBERNETES_NAMESPACE",
              "valueFrom" : {
                "fieldRef" : {
                  "fieldPath" : "metadata.namespace"
                }
              }
            } ],
            "image" : "yourDockerUsername/test-quarkus-app:1.0-SNAPSHOT",
            "imagePullPolicy" : "Always",
            "name" : "test-quarkus-app"
          } ]
        }
      }
    }
  },
  {
  "apiVersion" : "v1",
  "kind" : "Service",
    "metadata" : {
      "annotations": {
       "app.quarkus.io/vcs-url" : "&lt;some url&gt;",
       "app.quarkus.io/commit-id" : "&lt;some git SHA&gt;",
      },
      "labels" : {
        "app.kubernetes.io/name" : "test-quarkus-app",
        "app.kubernetes.io/version" : "1.0-SNAPSHOT",
      },
      "name" : "test-quarkus-app"
    },
  "spec" : {
    "ports" : [ {
      "name" : "http",
      "port" : 8080,
      "targetPort" : 8080
    } ],
    "selector" : {
      "app.kubernetes.io/name" : "test-quarkus-app",
      "app.kubernetes.io/version" : "1.0-SNAPSHOT"
    },
    "type" : "ClusterIP"
  }
 }
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>The generated manifest can be applied to the cluster from the project root using <code>kubectl</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">kubectl apply -f target/kubernetes/kubernetes.json</code></pre>
</div>
</div>
<div class="paragraph">
<p>An important thing to note about the <code>Deployment</code> is that is uses <code>yourDockerUsername/test-quarkus-app:1.0-SNAPSHOT</code> as the container image of the <code>Pod</code>.
The name of the image is controlled by the Jib extension and can be customized using the usual <code>application.properties</code>.</p>
</div>
<div class="paragraph">
<p>For example with a configuration like:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">quarkus.container-image.group=quarkus #optional, default to the system user name
quarkus.container-image.name=demo-app #optional, defaults to the application name
quarkus.container-image.tag=1.0       #optional, defaults to the application version</code></pre>
</div>
</div>
<div class="paragraph">
<p>The image that will be used in the generated manifests will be <code>quarkus/demo-app:1.0</code></p>
</div>
<div class="sect2">
<h3 id="defining-a-docker-registry"><a class="anchor" href="#defining-a-docker-registry"></a>Defining a Docker registry</h3>
<div class="paragraph">
<p>The Docker registry can be specified with the following property:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">quarkus.container-image.registry=my.docker-registry.net</code></pre>
</div>
</div>
<div class="paragraph">
<p>By adding this property along with the rest of the container image properties of the previous section, the generated manifests will use the image <code>my.docker-registry.net/quarkus/demo-app:1.0</code>.
The image is not the only thing that can be customized in the generated manifests, as will become evident in the following sections.</p>
</div>
</div>
<div class="sect2">
<h3 id="labels-and-annotations"><a class="anchor" href="#labels-and-annotations"></a>Labels and Annotations</h3>
<div class="sect3">
<h4 id="labels"><a class="anchor" href="#labels"></a>Labels</h4>
<div class="paragraph">
<p>The generated manifests use the Kubernetes <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels">recommended labels</a>.
These labels can be customized using <code>quarkus.kubernetes.name</code>, <code>quarkus.kubernetes.version</code> and <code>quarkus.kubernetes.part-of</code>.
For example by adding the following configuration to your <code>application.properties</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">quarkus.kubernetes.part-of=todo-app
quarkus.kubernetes.name=todo-rest
quarkus.kubernetes.version=1.0-rc.1</code></pre>
</div>
</div>
<div class="paragraph">
<p>The labels in generated resources will look like:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="json" class="language-json hljs">  "labels" : {
    "app.kubernetes.io/part-of" : "todo-app",
    "app.kubernetes.io/name" : "todo-rest",
    "app.kubernetes.io/version" : "1.0-rc.1"
  }</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="custom-labels"><a class="anchor" href="#custom-labels"></a>Custom Labels</h4>
<div class="paragraph">
<p>To add additional custom labels, for example <code>foo=bar</code> just apply the following configuration:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">quarkus.kubernetes.labels.foo=bar</code></pre>
</div>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
When using the <code>quarkus-container-image-jib</code> extension to build a container image, then any label added via the aforementioned property will also be added to the generated container image.
</td>
</tr>
</table>
</div>
</div>
<div class="sect3">
<h4 id="annotations"><a class="anchor" href="#annotations"></a>Annotations</h4>
<div class="paragraph">
<p>Out of the box, the generated resources will be annotated with version control related information that can be used either by tooling, or by the user for troubleshooting purposes.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="json" class="language-json hljs">  "annotations": {
    "app.quarkus.io/vcs-url" : "&lt;some url&gt;",
    "app.quarkus.io/commit-id" : "&lt;some git SHA&gt;",
   }</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="custom-annotations"><a class="anchor" href="#custom-annotations"></a>Custom Annotations</h4>
<div class="paragraph">
<p>Custom annotations can be added in a way similar to labels.For example to add the annotation <code>foo=bar</code> and <code>app.quarkus/id=42</code> just apply the following configuration:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">quarkus.kubernetes.annotations.foo=bar
quarkus."app.quarkus/id"=42</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="env-vars"><a class="anchor" href="#env-vars"></a>Environment variables</h4>
<div class="paragraph">
<p>Kubernetes provides multiple ways of defining environment variables:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>key/value pairs</p>
</li>
<li>
<p>import all values from a Secret or ConfigMap</p>
</li>
<li>
<p>interpolate a single value identified by a given field in a Secret or ConfigMap</p>
</li>
<li>
<p>interpolate a value from a field within the same resource</p>
</li>
</ul>
</div>
<div class="sect4">
<h5 id="environment-variables-from-keyvalue-pairs"><a class="anchor" href="#environment-variables-from-keyvalue-pairs"></a>Environment variables from key/value pairs</h5>
<div class="paragraph">
<p>To add a key/value pair as an environment variable in the generated resources:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="properties" class="language-properties hljs">quarkus.kubernetes.env.vars.my-env-var=foobar</code></pre>
</div>
</div>
<div class="paragraph">
<p>The command above will add <code>MY_ENV_VAR=foobar</code> as an environment variable.
Please note that the key <code>my-env-var</code> will be converted to uppercase and dashes will be replaced by underscores resulting in <code>MY_ENV_VAR</code>.</p>
</div>
</div>
<div class="sect4">
<h5 id="environment-variables-from-secret"><a class="anchor" href="#environment-variables-from-secret"></a>Environment variables from Secret</h5>
<div class="paragraph">
<p>To add all key/value pairs of <code>Secret</code> as environment variables just apply the following configuration, separating each <code>Secret</code>
to be used as source by a comma (<code>,</code>):</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="properties" class="language-properties hljs">quarkus.kubernetes.env.secrets=my-secret,my-other-secret</code></pre>
</div>
</div>
<div class="paragraph">
<p>which would generate the following in the container definition:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="yaml" class="language-yaml hljs">envFrom:
  - secretRef:
      name: my-secret
      optional: false
  - secretRef:
      name: my-other-secret
      optional: false</code></pre>
</div>
</div>
<div class="paragraph">
<p>The following extracts a value identified by the <code>keyName</code> field from the <code>my-secret</code> Secret into a <code>foo</code> environment variable:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="properties" class="language-properties hljs">quarkus.kubernetes.env.mapping.foo.from-secret=my-secret
quarkus.kubernetes.env.mapping.foo.with-key=keyName</code></pre>
</div>
</div>
<div class="paragraph">
<p>This would generate the following in the <code>env</code> section of your container:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="yaml" class="language-yaml hljs">- env:
  - name: FOO
    valueFrom:
      secretKeyRef:
        key: keyName
        name: my-secret
        optional: false</code></pre>
</div>
</div>
</div>
<div class="sect4">
<h5 id="environment-variables-from-configmap"><a class="anchor" href="#environment-variables-from-configmap"></a>Environment variables from ConfigMap</h5>
<div class="paragraph">
<p>To add all key/value pairs from <code>ConfigMap</code> as environment variables just apply the following configuration, separating each
<code>ConfigMap</code> to be used as source by a comma (<code>,</code>):</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="properties" class="language-properties hljs">quarkus.kubernetes.env.configmaps=my-config-map,another-config-map</code></pre>
</div>
</div>
<div class="paragraph">
<p>which would generate the following in the container definition:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="yaml" class="language-yaml hljs">envFrom:
  - configMapRef:
      name: my-config-map
      optional: false
  - configMapRef:
      name: another-config-map
      optional: false</code></pre>
</div>
</div>
<div class="paragraph">
<p>The following extracts a value identified by the <code>keyName</code> field from the <code>my-config-map</code> ConfigMap into a <code>foo</code>
environment variable:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="properties" class="language-properties hljs">quarkus.kubernetes.env.mapping.foo.from-configmap=my-configmap
quarkus.kubernetes.env.mapping.foo.with-key=keyName</code></pre>
</div>
</div>
<div class="paragraph">
<p>This would generate the following in the <code>env</code> section of your container:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="yaml" class="language-yaml hljs">- env:
  - name: FOO
    valueFrom:
      configMapRefKey:
        key: keyName
        name: my-configmap
        optional: false</code></pre>
</div>
</div>
</div>
<div class="sect4">
<h5 id="environment-variables-from-fields"><a class="anchor" href="#environment-variables-from-fields"></a>Environment variables from fields</h5>
<div class="paragraph">
<p>It&#8217;s also possible to use the value from another field to add a new environment variable by specifying the path of the field to be used as a source, as follows:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">quarkus.kubernetes.env.fields.foo=metadata.name</code></pre>
</div>
</div>
</div>
<div class="sect4">
<h5 id="validation"><a class="anchor" href="#validation"></a>Validation</h5>
<div class="paragraph">
<p>A conflict between two definitions, e.g. mistakenly assigning both a value and specifying that a variable is derived from a field, will result in an error being thrown at build time so that you get the opportunity to fix the issue before you deploy your application to your cluster where it might be more difficult to diagnose the source of the issue.</p>
</div>
<div class="paragraph">
<p>Similarly, two redundant definitions, e.g. defining an injection from the same secret twice, will not cause an issue but will indeed report a warning to let you know that you might not have intended to duplicate that definition.</p>
</div>
</div>
<div class="sect4">
<h5 id="env-vars-backwards"><a class="anchor" href="#env-vars-backwards"></a>Backwards compatibility</h5>
<div class="paragraph">
<p>Previous versions of the Kubernetes extension supported a different syntax to add environment variables.The older syntax is still supported but is deprecated and it&#8217;s advised that you migrate to the new syntax.</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<caption class="title">Table 1. Old vs. new syntax</caption>
<colgroup>
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
</colgroup>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Old</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">New</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Plain variable</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>quarkus.kubernetes.env-vars.my-env-var.value=foobar</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>quarkus.kubernetes.env.vars.my-env-var=foobar</code></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">From field</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>quarkus.kubernetes.env-vars.my-env-var.field=foobar</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>quarkus.kubernetes.env.fields.my-env-var=foobar</code></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">All from <code>ConfigMap</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>quarkus.kubernetes.env-vars.xxx.configmap=foobar</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>quarkus.kubernetes.env.configmaps=foobar</code></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">All from <code>Secret</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>quarkus.kubernetes.env-vars.xxx.secret=foobar</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>quarkus.kubernetes.env.secrets=foobar</code></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">From one <code>Secret</code> field</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>quarkus.kubernetes.env-vars.foo.secret=foobar</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>quarkus.kubernetes.env.mapping.foo.from-secret=foobar</code></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>quarkus.kubernetes.env-vars.foo.value=field</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>quarkus.kubernetes.env.mapping.foo.with-key=field</code></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">From one <code>ConfigMap</code> field</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>quarkus.kubernetes.env-vars.foo.configmap=foobar</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>quarkus.kubernetes.env.mapping.foo.from-configmap=foobar</code></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>quarkus.kubernetes.env-vars.foo.value=field</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>quarkus.kubernetes.env.mapping.foo.with-key=field</code></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
If you redefine the same variable using the new syntax while keeping the old syntax, <strong>ONLY</strong> the new version will be kept
and a warning will be issued to alert you of the problem.For example, if you define both
<code>quarkus.kubernetes.env-vars.my-env-var.value=foobar</code> and <code>quarkus.kubernetes.env.vars.my-env-var=newValue</code>, the extension will
only generate an environment variable <code>MY_ENV_VAR=newValue</code> and issue a warning.
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect3">
<h4 id="mounting-volumes"><a class="anchor" href="#mounting-volumes"></a>Mounting volumes</h4>
<div class="paragraph">
<p>The Kubernetes extension allows the user to configure both volumes and mounts for the application.
Any volume can be mounted with a simple configuration:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">quarkus.kubernetes.mounts.my-volume.path=/where/to/mount</code></pre>
</div>
</div>
<div class="paragraph">
<p>This will add a mount to the pod for volume <code>my-volume</code> to path <code>/where/to/mount</code>.
The volumes themselves can be configured as shown in the sections below.</p>
</div>
<div class="sect4">
<h5 id="secret-volumes"><a class="anchor" href="#secret-volumes"></a>Secret volumes</h5>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">quarkus.kubernetes.secret-volumes.my-volume.secret-name=my-secret</code></pre>
</div>
</div>
</div>
<div class="sect4">
<h5 id="configmap-volumes"><a class="anchor" href="#configmap-volumes"></a>ConfigMap volumes</h5>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">quarkus.kubernetes.config-map-volumes.my-volume.config-map-name=my-secret</code></pre>
</div>
</div>
</div>
</div>
</div>
<div class="sect2">
<h3 id="changing-the-number-of-replicas"><a class="anchor" href="#changing-the-number-of-replicas"></a>Changing the number of replicas:</h3>
<div class="paragraph">
<p>To change the number of replicas from 1 to 3:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">quarkus.kubernetes.replicas=3</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="add-readiness-and-liveness-probes"><a class="anchor" href="#add-readiness-and-liveness-probes"></a>Add readiness and liveness probes</h3>
<div class="paragraph">
<p>By default, the Kubernetes resources do not contain readiness and liveness probes in the generated <code>Deployment</code>. Adding them however is just a matter of adding the SmallRye Health extension like so:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="xml" class="language-xml hljs">    &lt;dependency&gt;
      &lt;groupId&gt;io.quarkus&lt;/groupId&gt;
      &lt;artifactId&gt;quarkus-smallrye-health&lt;/artifactId&gt;
    &lt;/dependency&gt;</code></pre>
</div>
</div>
<div class="paragraph">
<p>The values of the generated probes will be determined by the configured health properties: <code>quarkus.smallrye-health.root-path</code>, <code>quarkus.smallrye-health.liveness-path</code> and <code>quarkus.smallrye-health.readiness-path</code>.
More information about the health extension can be found in the relevant <a href="microprofile-health">guide</a>.</p>
</div>
</div>
<div class="sect2">
<h3 id="customizing-the-readiness-probe"><a class="anchor" href="#customizing-the-readiness-probe"></a>Customizing the readiness probe:</h3>
<div class="paragraph">
<p>To set the initial delay of the probe to 20 seconds and the period to 45:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">quarkus.kubernetes.readiness-probe.initial-delay=20s
quarkus.kubernetes.readiness-probe.period=45s</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="using-the-kubernetes-client"><a class="anchor" href="#using-the-kubernetes-client"></a>Using the Kubernetes client</h3>
<div class="paragraph">
<p>Applications that are deployed to Kubernetes and need to access the API server will usually make use of the <code>kubernetes-client</code> extension:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="xml" class="language-xml hljs">    &lt;dependency&gt;
      &lt;groupId&gt;io.quarkus&lt;/groupId&gt;
      &lt;artifactId&gt;quarkus-kubernetes-client&lt;/artifactId&gt;
    &lt;/dependency&gt;</code></pre>
</div>
</div>
<div class="paragraph">
<p>To access the API server from within a Kubernetes cluster, some RBAC related resources are required (e.g. a ServiceAccount, a RoleBinding etc.).
So, when the <code>kubernetes-client</code> extension is present, the <code>kubernetes</code> extension is going to create those resources automatically, so that application will be granted the <code>view</code> role.
If more roles are required, they will have to be added manually.</p>
</div>
</div>
<div class="sect2">
<h3 id="deploying-to-minikube"><a class="anchor" href="#deploying-to-minikube"></a>Deploying to Minikube</h3>
<div class="paragraph">
<p><a href="https://github.com/kubernetes/minikube">Minikube</a> is quite popular when a Kubernetes cluster is needed for development purposes. To make the deployment to Minikube
experience as frictionless as possible, Quarkus provides the <code>quarkus-minikube</code> extension. This extension can be added to a project like so:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="xml" class="language-xml hljs">&lt;dependency&gt;
    &lt;groupId&gt;io.quarkus&lt;/groupId&gt;
    &lt;artifactId&gt;quarkus-minikube&lt;/artifactId&gt;
&lt;/dependency&gt;</code></pre>
</div>
</div>
<div class="paragraph">
<p>The purpose of this extension is to generate Kubernetes manifests (<code>minikube.yaml</code> and <code>minikube.json</code>) that are tailored to Minikube.
This extension assumes a couple things:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Users won&#8217;t be using an image registry and will instead make their container image accessible to the Kubernetes cluster by building it directly
into Minikube&#8217;s Docker daemon. To use Minikube&#8217;s Docker daemon you must first execute:</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">eval $(minikube -p minikube docker-env)</code></pre>
</div>
</div>
</li>
<li>
<p>Applications deployed to Kubernetes won&#8217;t be accessed via a Kubernetes <code>Ingress</code>, but rather as a <code>NodePort</code> <code>Service</code>.
The advantage of doing this is that the URL of an application can be retrieved trivially by executing:</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">minikube service list</code></pre>
</div>
</div>
</li>
</ul>
</div>
<div class="paragraph">
<p>To control the <a href="https://kubernetes.io/docs/concepts/services-networking/service/#nodeport">nodePort</a> that is used in this case, users can set <code>quarkus.kubernetes.node-port</code>.
Note however that this configuration is entirely optional because Quarkus will automatically use a proper (and non-changing) value if none is set.</p>
</div>
<div class="admonitionblock warning">
<table>
<tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
It is highly discouraged to use the manifests generated by the Minikube extension when deploying to production as these manifests are intended for development purposes
only. When deploying to production, consider using the vanilla Kubernetes manifests (or the OpenShift ones when targeting OpenShift).
</td>
</tr>
</table>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
If the assumptions the Minikube extension makes don&#8217;t fit your workflow, nothing prevents you from using the regular Kubernetes extension to generate Kubernetes manifests
and apply those to your Minikube cluster.
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="tuning-the-generated-resources-using-application-properties"><a class="anchor" href="#tuning-the-generated-resources-using-application-properties"></a>Tuning the generated resources using application.properties</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The Kubernetes extension allows tuning the generated manifest, using the <code>application.properties</code> file.
Here are some examples:</p>
</div>
<div class="sect2">
<h3 id="configuration-options"><a class="anchor" href="#configuration-options"></a>Configuration options</h3>
<div class="paragraph">
<p>The table below describe all the available configuration options.</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<caption class="title">Table 2. Kubernetes</caption>
<colgroup>
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
</colgroup>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Property</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Type</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Default Value</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.name</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">${quarkus.container-image.name}</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.version</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">${quarkus.container-image.tag}</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.part-of</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.init-containers</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, Container&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.labels</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.annotations</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.env-vars</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, Env&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.working-dir</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.command</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String[]</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.arguments</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String[]</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.replicas</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">int</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">1</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.service-account</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.host</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.ports</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, Port&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.service-type</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ServiceType</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ClusterIP</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.pvc-volumes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, PersistentVolumeClaimVolume&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.secret-volumes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, SecretVolume&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.config-map-volumes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, ConfigMapVolume&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.git-repo-volumes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, GitRepoVolume&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.aws-elastic-block-store-volumes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, AwsElasticBlockStoreVolume&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.azure-disk-volumes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, AzureDiskVolume&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.azure-file-volumes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, AzureFileVolume&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.mounts</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, Mount&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.image-pull-policy</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ImagePullPolicy</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Always</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.image-pull-secrets</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String[]</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.liveness-probe</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Probe</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">( see Probe )</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.readiness-probe</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Probe</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">( see Probe )</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.sidecars</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, Container&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.expose</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.kubernetes.headless</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
<p>Properties that use non-standard types, can be referenced by expanding the property.
For example to define a <code>kubernetes-readiness-probe</code> which is of type <code>Probe</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">quarkus.kubernetes.readiness-probe.initial-delay=20s
quarkus.kubernetes.readiness-probe.period=45s</code></pre>
</div>
</div>
<div class="paragraph">
<p>In this example <code>initial-delay</code> and <code>period</code> are fields of the type <code>Probe</code>.
Below you will find tables describing all available types.</p>
</div>
<div class="sect3">
<h4 id="basic-types"><a class="anchor" href="#basic-types"></a>Basic Types</h4>
<div class="paragraph">
<div class="title">ServiceType</div>
<p>Allowed values: <code>cluster-ip</code>, <code>node-port</code>, <code>load-balancer</code>, <code>external-name</code></p>
</div>
<table class="tableblock frame-all grid-all stretch">
<caption class="title">Table 3. Env</caption>
<colgroup>
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
</colgroup>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Property</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Type</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Default Value</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">value</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">secret</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">configmap</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">field</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
<table class="tableblock frame-all grid-all stretch">
<caption class="title">Table 4. Probe</caption>
<colgroup>
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
</colgroup>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Property</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Type</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Default Value</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">http-action-path</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">exec-action</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">tcp-socket-action</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">initial-delay</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Duration</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">period</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Duration</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">30s</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">timeout</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Duration</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">10s</p></td>
</tr>
</tbody>
</table>
<table class="tableblock frame-all grid-all stretch">
<caption class="title">Table 5. Port</caption>
<colgroup>
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
</colgroup>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Property</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Type</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Default Value</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">container-port</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">int</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">host-port</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">int</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">path</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">/</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">protocol</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Protocol</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">TCP</p></td>
</tr>
</tbody>
</table>
<table class="tableblock frame-all grid-all stretch">
<caption class="title">Table 6. Container</caption>
<colgroup>
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
</colgroup>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Property</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Type</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Default Value</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">image</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">env-vars</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Env[]</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">working-dir</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">command</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String[]</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">arguments</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String[]</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">ports</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Port[]</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">mounts</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Mount[]</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">image-pull-policy</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ImagePullPolicy</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Always</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">liveness-probe</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Probe</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">readiness-probe</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Probe</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
</div>
<div class="sect3">
<h4 id="mounts-and-volumes"><a class="anchor" href="#mounts-and-volumes"></a>Mounts and Volumes</h4>
<table class="tableblock frame-all grid-all stretch">
<caption class="title">Table 7. Mount</caption>
<colgroup>
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
</colgroup>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Property</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Type</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Default Value</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">path</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">sub-path</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">read-only</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
</tr>
</tbody>
</table>
<table class="tableblock frame-all grid-all stretch">
<caption class="title">Table 8. ConfigMapVolume</caption>
<colgroup>
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
</colgroup>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Property</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Type</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Default Value</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">config-map-name</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">default-mode</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">int</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0600</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">optional</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
</tr>
</tbody>
</table>
<table class="tableblock frame-all grid-all stretch">
<caption class="title">Table 9. SecretVolume</caption>
<colgroup>
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
</colgroup>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Property</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Type</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Default Value</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">secret-name</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">default-mode</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">int</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0600</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">optional</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
</tr>
</tbody>
</table>
<table class="tableblock frame-all grid-all stretch">
<caption class="title">Table 10. AzureDiskVolume</caption>
<colgroup>
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
</colgroup>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Property</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Type</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Default Value</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">disk-name</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">disk-uri</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">kind</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Managed</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">caching-mode</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ReadWrite</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">fs-type</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ext4</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">read-only</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
</tr>
</tbody>
</table>
<table class="tableblock frame-all grid-all stretch">
<caption class="title">Table 11. AwsElasticBlockStoreVolume</caption>
<colgroup>
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
</colgroup>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Property</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Type</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Default Value</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">volume-id</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">partition</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">int</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">fs-type</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ext4</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">read-only</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
</tr>
</tbody>
</table>
<table class="tableblock frame-all grid-all stretch">
<caption class="title">Table 12. GitRepoVolume</caption>
<colgroup>
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
</colgroup>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Property</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Type</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Default Value</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">repository</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">directory</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">revision</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
<table class="tableblock frame-all grid-all stretch">
<caption class="title">Table 13. PersistentVolumeClaimVolume</caption>
<colgroup>
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
</colgroup>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Property</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Type</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Default Value</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">claim-name</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">read-only</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
</tr>
</tbody>
</table>
<table class="tableblock frame-all grid-all stretch">
<caption class="title">Table 14. AzureFileVolume</caption>
<colgroup>
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
</colgroup>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Property</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Type</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Default Value</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">share-name</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">secret-name</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">read-only</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sect2">
<h3 id="openshift"><a class="anchor" href="#openshift"></a>OpenShift</h3>
<div class="paragraph">
<p>To enable the generation of OpenShift resources, you need to include OpenShift in the target platforms:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">quarkus.kubernetes.deployment-target=openshift</code></pre>
</div>
</div>
<div class="paragraph">
<p>If you need to generate resources for both platforms (vanilla Kubernetes and OpenShift), then you need to include both (comma separated).</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">quarkus.kubernetes.deployment-target=kubernetes,openshift</code></pre>
</div>
</div>
<div class="paragraph">
<p>Following the execution of <code>./mvnw package</code> you will notice amongst the other files that are created, two files named
<code>openshift.json</code> and <code>openshift.yml</code> in the <code>target/kubernetes/</code> directory.</p>
</div>
<div class="paragraph">
<p>These manifests can be deployed as is to a running cluster, using <code>kubectl</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">kubectl apply -f target/kubernetes/openshift.json</code></pre>
</div>
</div>
<div class="paragraph">
<p>Openshift users might want to use <code>oc</code> instead of <code>kubectl</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">oc apply -f target/kubernetes/openshift.json</code></pre>
</div>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Quarkus also provides the <a href="deploying-to-openshift">OpenShift</a> extension. This extension is basically a wrapper around the Kubernetes extension and
relieves OpenShift users of the necessity of setting the <code>deployment-target</code> property to <code>openshift</code>
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>The OpenShift resources can be customized in a similar approach with Kubernetes.</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<caption class="title">Table 15. OpenShift</caption>
<colgroup>
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
</colgroup>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Property</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Type</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Default Value</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.name</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">${quarkus.container-image.name}</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.version</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">${quarkus.container-image.tag}</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.part-of</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.init-containers</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, Container&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.labels</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.annotations</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.env-vars</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, Env&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.working-dir</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.command</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String[]</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.arguments</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String[]</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.replicas</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">int</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">1</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.service-account</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.host</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.ports</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, Port&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.service-type</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ServiceType</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ClusterIP</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.pvc-volumes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, PersistentVolumeClaimVolume&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.secret-volumes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, SecretVolume&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.config-map-volumes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, ConfigMapVolume&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.git-repo-volumes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, GitRepoVolume&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.aws-elastic-block-store-volumes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, AwsElasticBlockStoreVolume&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.azure-disk-volumes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, AzureDiskVolume&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.azure-file-volumes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, AzureFileVolume&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.mounts</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, Mount&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.image-pull-policy</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ImagePullPolicy</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Always</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.image-pull-secrets</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String[]</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.liveness-probe</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Probe</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">( see Probe )</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.readiness-probe</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Probe</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">( see Probe )</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.sidecars</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, Container&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.expose</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.openshift.headless</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
</tr>
</tbody>
</table>
</div>
<div class="sect2">
<h3 id="knative"><a class="anchor" href="#knative"></a>Knative</h3>
<div class="paragraph">
<p>To enable the generation of Knative resources, you need to include Knative in the target platforms:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">quarkus.kubernetes.deployment-target=knative</code></pre>
</div>
</div>
<div class="paragraph">
<p>Following the execution of <code>./mvnw package</code> you will notice amongst the other files that are created, two files named
<code>knative.json</code> and <code>knative.yml</code> in the <code>target/kubernetes/</code> directory.</p>
</div>
<div class="paragraph">
<p>If you look at either file you will see that it contains a Knative <code>Service</code>.</p>
</div>
<div class="paragraph">
<p>The full source of the <code>knative.json</code> file looks something like this:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="json" class="language-json hljs">{
  {
    "apiVersion" : "serving.quarkus.knative.dev/v1alpha1",
    "kind" : "Service",
    "metadata" : {
      "annotations": {
       "app.quarkus.io/vcs-url" : "&lt;some url&gt;",
       "app.quarkus.io/commit-id" : "&lt;some git SHA&gt;"
      },
      "labels" : {
        "app.kubernetes.io/name" : "test-quarkus-app",
        "app.kubernetes.io/version" : "1.0-SNAPSHOT"
      },
      "name" : "knative.
    },
    "spec" : {
      "runLatest" : {
        "configuration" : {
          "revisionTemplate" : {
            "spec" : {
              "container" : {
                "image" : "dev.local/yourDockerUsername/test-quarkus-app:1.0-SNAPSHOT",
                "imagePullPolicy" : "Always"
              }
            }
          }
        }
      }
    }
  }
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>The generated manifest can be deployed as is to a running cluster, using <code>kubectl</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">kubectl apply -f target/kubernetes/knative.json</code></pre>
</div>
</div>
<div class="paragraph">
<p>The generated service can be customized using the following properties:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<caption class="title">Table 16. Knative</caption>
<colgroup>
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
</colgroup>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Property</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Type</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Default Value</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.knative.name</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">${quarkus.container-image.name}</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.knative.version</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">${quarkus.container-image.tag}</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.knative.part-of</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.knative.init-containers</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, Container&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.knative.labels</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.knative.annotations</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.knative.env-vars</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, Env&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.knative.working-dir</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.knative.command</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String[]</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.knative.arguments</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String[]</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.knative.replicas</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">int</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">1</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.knative.service-account</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.knative.host</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.knative.ports</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, Port&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.knative.service-type</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ServiceType</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ClusterIP</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.knative.pvc-volumes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, PersistentVolumeClaimVolume&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.knative.secret-volumes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, SecretVolume&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.knative.config-map-volumes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, ConfigMapVolume&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.knative.git-repo-volumes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, GitRepoVolume&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.knative.aws-elastic-block-store-volumes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, AwsElasticBlockStoreVolume&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.knative.azure-disk-volumes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, AzureDiskVolume&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.knative.azure-file-volumes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, AzureFileVolume&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.knative.mounts</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, Mount&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.knative.image-pull-policy</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ImagePullPolicy</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Always</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.knative.image-pull-secrets</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String[]</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.knative.liveness-probe</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Probe</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">( see Probe )</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.knative.readiness-probe</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Probe</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">( see Probe )</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">quarkus.knative.sidecars</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Map&lt;String, Container&gt;</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
</div>
<div class="sect2">
<h3 id="deployment-targets"><a class="anchor" href="#deployment-targets"></a>Deployment targets</h3>
<div class="paragraph">
<p>Mentioned in the previous sections was the concept of <code>deployment-target</code>. This concept allows users to control which Kubernetes manifests will be generated
and deployed to a cluster (if <code>quarkus.kubernetes.deploy</code> has been set to <code>true</code>).</p>
</div>
<div class="paragraph">
<p>By default, when no <code>deployment-target</code> is set, then only vanilla Kubernetes resources are generated and deployed. When multiple values are set (for example
<code>quarkus.kubernetes.deployment-target=kubernetes,openshift</code>) then the resources for all targets are generated, but only the resources
that correspond to the <strong>first</strong> target are applied to the cluster (if deployment is enabled).</p>
</div>
<div class="paragraph">
<p>In the case of wrapper extensions like OpenShift and Minikube, when these extensions have been explicitly added to the project, the default <code>deployment-target</code>
is set by those extensions. For example if <code>quarkus-minikube</code> has been added to a project, then <code>minikube</code> becomes the default deployment target and its
resources will be applied to the Kubernetes cluster when deployment via <code>quarkus.kubernetes.deploy</code> has been set.
Users can still override the deployment-targets manually using <code>quarkus.kubernetes.deployment-target</code>.</p>
</div>
</div>
<div class="sect2">
<h3 id="deprecated-configuration"><a class="anchor" href="#deprecated-configuration"></a>Deprecated configuration</h3>
<div class="paragraph">
<p>The following categories of configuration properties have been deprecated.</p>
</div>
<div class="sect3">
<h4 id="properties-without-the-quarkus-prefix"><a class="anchor" href="#properties-without-the-quarkus-prefix"></a>Properties without the quarkus prefix</h4>
<div class="paragraph">
<p>In earlier versions of the extension, the <code>quarkus.</code> was missing from those properties. These properties are now deprecated.</p>
</div>
</div>
<div class="sect3">
<h4 id="docker-and-s2i-properties"><a class="anchor" href="#docker-and-s2i-properties"></a>Docker and S2i properties</h4>
<div class="paragraph">
<p>The properties for configuring <code>docker</code> and <code>s2i</code> are also deprecated in favor of the new container-image extensions.</p>
</div>
</div>
<div class="sect3">
<h4 id="config-group-arrays"><a class="anchor" href="#config-group-arrays"></a>Config group arrays</h4>
<div class="paragraph">
<p>Properties referring to config group arrays (e.g. <code>kubernetes.labels[0]</code>, <code>kubernetes.env-vars[0]</code> etc) have been converted to maps, to align with the rest of the Quarkus ecosystem.</p>
</div>
<div class="paragraph">
<p>The code below demonstrates the change in <code>labels</code> config:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs"># Old labels config:
kubernetes.labels[0].name=foo
kubernetes.labels[0].value=bar

# New labels
quarkus.kubernetes.labels.foo=bar</code></pre>
</div>
</div>
<div class="paragraph">
<p>The code below demonstrates the change in <code>env-vars</code> config:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs"># Old env-vars config:
kubernetes.env-vars[0].name=foo
kubernetes.env-vars[0].configmap=my-configmap

# New env-vars
quarkus.kubernetes.env-vars.foo.configmap=myconfigmap</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="env-vars-properties"><a class="anchor" href="#env-vars-properties"></a><code>env-vars</code> properties</h4>
<div class="paragraph">
<p><code>quarkus.kubernetes.env-vars</code> are deprecated (though still currently supported as of this writing) and the new declaration style should be used instead.
See <a href="#env-vars">Environment variables</a> and more specifically <a href="#env-vars-backwards">Backwards compatibility</a> for more details.</p>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="deployment"><a class="anchor" href="#deployment"></a>Deployment</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To trigger building and deploying a container image you need to enable the <code>quarkus.kubernetes.deploy</code> flag (the flag is disabled by default - furthermore it has no effect during test runs or dev mode).
This can be easily done with the command line:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">./mvnw clean package -Dquarkus.kubernetes.deploy=true</code></pre>
</div>
</div>
<div class="sect2">
<h3 id="building-a-container-image"><a class="anchor" href="#building-a-container-image"></a>Building a container image</h3>
<div class="paragraph">
<p>Building a container image is possible, using any of the 3 available <code>container-image</code> extensions:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="container-image#docker">Docker</a></p>
</li>
<li>
<p><a href="container-image#jib">Jib</a></p>
</li>
<li>
<p><a href="container-image#s2i">s2i</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Each time deployment is requested, a container image build will be implicitly triggered (no additional properties are required when the Kubernetes deployment has been enabled).</p>
</div>
</div>
<div class="sect2">
<h3 id="deploying"><a class="anchor" href="#deploying"></a>Deploying</h3>
<div class="paragraph">
<p>When deployment is enabled, the Kubernetes extension will select the resources specified by <code>quarkus.kubernetes.deployment.target</code> and deploy them.
This assumes that a <code>.kube/config</code> is available in your user directory that points to the target Kubernetes cluster.
In other words the extension will use whatever cluster <code>kubectl</code> uses. The same applies to credentials.</p>
</div>
<div class="paragraph">
<p>At the moment no additional options are provided for further customization.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="using-existing-resources"><a class="anchor" href="#using-existing-resources"></a>Using existing resources</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Sometimes it&#8217;s desirable to either provide additional resources (e.g. a ConfigMap, a Secret, a Deployment for a database etc) or provide custom ones that will be used as a <code>base</code> for the generation process.
Those resources can be added under <code>src/main/kubernetes</code> directory and can be named after the target environment (e.g. kubernetes.json, openshift.json, knative.json, or the yml equivalents). Each of these files may contain one or more Kubernetes resources.</p>
</div>
<div class="paragraph">
<p>Any resource found will be added in the generated manifests. Global modifications (e.g. labels, annotations etc) will also be applied to those resources.
If one of the provided resources has the same name as one of the generated ones, then the generated resource will be created on top of the provided resource, respecting existing content when possible (e.g. existing labels, annotations, environment variables, mounts, replicas etc).</p>
</div>
<div class="paragraph">
<p>The name of the resource is determined by the application name and may be overridden by <code>quarkus.kubernetes.name</code>, <code>quarkus.openshift.name</code> and <code>quarkus.knative.name</code>.</p>
</div>
<div class="paragraph">
<p>For example, in the <code>kubernetes-quickstart</code> application, we can add a <code>kubernetes.yml</code> file in the <code>src/main/kubernetes</code> that looks like:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="yaml" class="language-yaml hljs">apiVersion: apps/v1
kind: Deployment
metadata:
  name: kubernetes-quickstart
  labels:
    app: quickstart
spec:
  replicas: 3
  selector:
    matchLabels:
      app: quickstart
  template:
    metadata:
      labels:
        app: quickstart
    spec:
      containers:
      - name: kubernetes-quickstart
        image: someimage:latest
        ports:
        - containerPort: 80
        env:
        - name: FOO
          value: BAR</code></pre>
</div>
</div>
<div class="paragraph">
<p>The generated <code>kubernetes.yml</code> will look like:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="yaml" class="language-yaml hljs">apiVersion: "apps/v1"
kind: "Deployment"
metadata:
  annotations:
    app.quarkus.io/build-timestamp: "2020-04-10 - 12:54:37 +0000"
  labels:
    app: "quickstart"
  name: "kubernetes-quickstart"
spec:
  replicas: 3 <i class="conum" data-value="1"></i><b>(1)</b>
  selector:
    matchLabels:
      app.kubernetes.io/name: "kubernetes-quickstart"
      app.kubernetes.io/version: "1.0-SNAPSHOT"
  template:
    metadata:
      annotations:
        app.quarkus.io/build-timestamp: "2020-04-10 - 12:54:37 +0000"
      labels:
        app: "quickstart" <i class="conum" data-value="2"></i><b>(2)</b>
    spec:
      containers:
      - env:
        - name: "FOO" <i class="conum" data-value="3"></i><b>(3)</b>
          value: "BAR"
        image: "&lt;&lt;yourDockerUsernmae&gt;&gt;/kubernetes-quickstart:1.0-SNAPSHOT" <i class="conum" data-value="4"></i><b>(4)</b>
        imagePullPolicy: "Always"
        name: "kubernetes-quickstart"
        ports:
        - containerPort: 8080 <i class="conum" data-value="5"></i><b>(5)</b>
          name: "http"
          protocol: "TCP"
      serviceAccount: "kubernetes-quickstart"</code></pre>
</div>
</div>
<div class="paragraph">
<p>The provided replicas &lt;1&gt;, labels &lt;2&gt; and environment variables &lt;3&gt;  were retained. However, the image &lt;4&gt; and container port &lt;5&gt; were modified. Moreover, the default annotations have been added.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="paragraph">
<p>If the resource name does not match the application name (or the overridden name) instead of reusing the resource a new one will be added. Same goes for the container.
If the name of the container does not match the application name (or the overridden name), container specific configuration will be ignored.</p>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
    </div>
  </div>
</div>

  </div>

  <div class="content project-footer">
  <div class="footer-section">
    <div class="logo-wrapper">
      <a href="/"><img src="/assets/images/quarkus_logo_horizontal_rgb_reverse.svg" class="project-logo" title="Quarkus"></a>
    </div>
  </div>
  <div class="grid-wrapper">
    <p class="grid__item width-3-12">Quarkus is open. All dependencies of this project are available under the <a href='https://www.apache.org/licenses/LICENSE-2.0' target='_blank'>Apache Software License 2.0</a> or compatible license.<br /><br />This website was built with <a href='https://jekyllrb.com/' target='_blank'>Jekyll</a>, is hosted on <a href='https://pages.github.com/' target='_blank'>Github Pages</a> and is completely open source. If you want to make it better, <a href='https://github.com/quarkusio/quarkusio.github.io' target='_blank'>fork the website</a> and show us what you’ve got.</p>

    
      <div class="width-1-12 project-links">
        <span>Navigation</span>
        <ul class="footer-links width-1-12">
          
            <li><a href="/">Home</a></li>
          
            <li><a href="/guides">Guides</a></li>
          
            <li><a href="/community/#contributing">Contribute</a></li>
          
            <li><a href="/faq">FAQ</a></li>
          
            <li><a href="/get-started">Get Started</a></li>
          
        </ul>
      </div>
    
      <div class="width-1-12 project-links">
        <span>Contribute</span>
        <ul class="footer-links width-1-12">
          
            <li><a href="https://twitter.com/quarkusio">Follow us</a></li>
          
            <li><a href="https://github.com/quarkusio">GitHub</a></li>
          
            <li><a href="/security">Security&nbsp;policy</a></li>
          
        </ul>
      </div>
    
      <div class="width-1-12 project-links">
        <span>Get Help</span>
        <ul class="footer-links width-1-12">
          
            <li><a href="https://groups.google.com/forum/#!forum/quarkus-dev">Forums</a></li>
          
            <li><a href="https://quarkusio.zulipchat.com">Chatroom</a></li>
          
        </ul>
      </div>
    

    
      <div class="width-3-12 more-links">
        <span>Quarkus is made of community projects</span>
        <ul class="footer-links">
          
            <li><a href="https://vertx.io/" target="_blank">Eclipse Vert.x</a></li>
          
            <li><a href="https://microprofile.io" target="_blank">Eclipse MicroProfile</a></li>
          
            <li><a href="https://hibernate.org" target="_blank">Hibernate</a></li>
          
            <li><a href="https://netty.io" target="_blank">Netty</a></li>
          
            <li><a href="https://resteasy.github.io" target="_blank">RESTEasy</a></li>
          
            <li><a href="https://camel.apache.org" target="_blank">Apache Camel</a></li>
          
            <li><a href="https://code.quarkus.io/" target="_blank">And many more...</a></li>
          
        </ul>
      </div>
    
  </div>
</div>
  <div class="content redhat-footer">
  <div class="grid-wrapper">
    <span class="licence">
      <i class="fab fa-creative-commons"></i><i class="fab fa-creative-commons-by"></i> <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank">CC by 3.0</a> | <a href="https://www.redhat.com/en/about/privacy-policy">Privacy Policy</a>
    </span>
    <span class="redhat">
      Sponsored by
    </span>
    <span class="redhat-logo">
      <a href="https://www.redhat.com/" target="_blank"><img src="/assets/images/redhat_reversed.svg"></a>
    </span>
  </div>
</div>


  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js" integrity="sha384-8gBf6Y4YYq7Jx97PIqmTwLPin4hxIzQw5aDmUg/DDhul9fFpbbLcLh3nTIIDJKhx" crossorigin="anonymous"></script>
  <script type="text/javascript" src="/assets/javascript/mobile-nav.js"></script>
  <script type="text/javascript" src="/assets/javascript/scroll-down.js"></script>
  <script src="/assets/javascript/satellite.js" type="text/javascript"></script>
  <script src="https://quarkus.io/guides/javascript/config.js" type="text/javascript"></script>
  <script src="/assets/javascript/search-filter.js" type="text/javascript"></script>
  <script src="/assets/javascript/back-to-top.js" type="text/javascript"></script>
</body>

</html>
